import request from './request.js'
// 获取全部学生
export function getAllStudent() {
  return request({
    url: `/students/gets`,
    method: 'GET'
  })
}

// 获取全部课程
export function getAllCourse() {
    return request({
      url: `/courses/courseList`,
      method: 'GET'
    })
  }

  // 批量导入成绩
  export function gradeImport(data) {
    return request({
      url: `/grades/import`,
      data:data,
      method: 'POST'
    })
  }
// 根据课程获取成绩
export function getCourseById(id) {
  return request({
    url: `/grades/gets`,
    data:{
      courseId:id
    },
    method: 'GET'
  })
}

// 修改成绩
export function updateScore(data) {
  return request({
    url: `/grades/updateScore`,
    data:{
      studentId:data.studentId,
      score:data.score
    },
    method: 'POST'
  })
}
  
export function findGrade(id,selectTerm) {
  return request({
    url: `/grades/findGrade`,
    data:{
      studentId:id,
      courseTerm:selectTerm
    },
    method: 'GET'
  })
}





